package com.hollysys.hollimsa.biz.istio.enhanceservice.controller;

import com.hollysys.hollimsa.biz.istio.enhanceservice.domain.EnhanceServiceDictDTO;
import com.hollysys.hollimsa.biz.istio.enhanceservice.service.EnhanceServiceService;
import com.hollysys.hollimsa.common.result.AjaxObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 获取kubernetes 该租户下所有的服务，因命令空间被打入标签，所以查询该命名空间下的全部服务
 *
 * @author wangyuxi
 * @date 2020/11/08
 **/
@RestController
@RequestMapping(value = "/serviceMesh")
@Api(tags = "kubernetes服务")
public class EnhanceServiceController {

    @Autowired
    private EnhanceServiceService enhanceServiceService;


    /**
     * 获取命名空间下的服务列表
     * @return  服务下拉列表
     */
    @ApiOperation(value = "服务列表",notes = "服务列表")
    @GetMapping(value = "/kubernetesServices")
    public AjaxObject<List<EnhanceServiceDictDTO>> getAllKubernetesServices() {
        return AjaxObject.customOk("", enhanceServiceService.getAllKubernetesServices());
    }

}
